package org.xdq.demo.components.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.xdq.demo.components.Food;
import org.xdq.demo.components.Person;

@Component
public class Boy implements Person {

    @Autowired
    @Qualifier("liangfen")
    private Food food;

    @Override
    public void eat() {
        System.out.println("小伙子狼吞虎咽地吃"+food.getName());
    }
}
